package com.zhiyuancode.mqack.message.base;

/**
 * 云商城订单服务错误码
 * - "0000" + code，如："00001xxx"、"00002xxx"、...、"00006xxx"
 *
 * @author 易永健[of1972]
 * email faryangsh@163.com
 * Date    2017-07-05
 */
public enum MqResendErrorCode {
    //================内部异常====================
    OBJECT_SERIALIZE_EXCEPTION("1011", "对象序列化失败"),
    JSON_DESERIALIZE_EXCEPTION("1011", "字符串反序列化失败"),

    //================外部调用异常 ====================
    REDIS_CONNECTION_EXCEPTION("2011", "Redis连接异常"),
    MQ_CONNECTION_EXCEPTION("2021", "MQ连接异常"),

    //================未知异常异常 ====================
    UNKNOW_EXCEPTION("3021", "未知异常");


    private String code;
    private String message;

    MqResendErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return getCode() + '-' + getMessage();
    }
}
